/**
 * ParseMer.java - 2012-6-14
 *
 * Licensed Property to China UnionPay Co., Ltd.
 * 
 * (C) Copyright of China UnionPay Co., Ltd. 2010
 *     All Rights Reserved.
 *
 * Project Info: China UnionPay Internet Acquiring Project
 * 
 * Modification History:
 * =============================================================================
 *   Author         Date          Description
 *   ------------ ---------- ---------------------------------------------------
 *        
 * =============================================================================
 */
package com.lijin.study.java.merstat;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

import com.lijin.study.java.util.FileLineProcessor;
import com.lijin.study.java.util.FileUtil;

/**
 * Description: 
 *
 * (C) Copyright of China UnionPay Co., Ltd. 2010.
 *
 */
public class ParseMer {

	public static void main(String[] args) throws Exception {
		final List<String> mers = new ArrayList<String>();
		FileUtil.readFileByLine(new File("mer_paymethod_info.del"), new FileLineProcessor() {
			@Override
			public void processLine(String line) {
				String[] strs = line.split("[,]");
				line = line.replaceAll("\"", "");
				if (strs.length != 7) {
					System.out.println(line);
				}
				String ctrl1 = strs[4];
				int paym = Integer.valueOf(ctrl1);
				if ((paym & 64) != 0) {
					mers.add(line);
				}
			}
		}, "GBK", 1);
		
		FileUtil.writeFileByLine(new File("D:\\rest.txt"), mers, "UTF-8");
	}
	
}
